// source --> http://maniaevent.pl/wp-content/plugins/facebook-comments-notifier/fb-comments.js?ver=4.9.8
// encode data for html context
// default: \n ->
\r ->
var FCN_HTML_BR = 1; // \n ->
var FCN_HTML_NBSP = 2; // ' ' ->
var FCN_HTML_NBSP_BR = 3; // 1 + 2
var FCN_HTML_BR_NBSP = 3; // 1 + 2
var FCN_HTML_PRESERVE = 4; // preserve
function fcn_htmlencode (str, ws) {
if ( str === null || str === undefined ) {
return '';
}
var str = new String(str);
str = str.replace(/&/g, "&");
str = str.replace(/>/g, ">");
str = str.replace(/");
}
} else {
// for attributes/general
str = str.replace(/\n/g, "
");
str = str.replace(/\r/g, "
");
}
return str.valueOf();
}
// similar to php string escape
function fcn_addslashes(str) {
if ( str === null || str === undefined ) {
return '';
}
str = new String( str );
var str = str.replace(/\\/g, '\\\\').
replace(/\u0008/g, '\\b').
replace(/\t/g, '\\t').
replace(/\n/g, '\\n').
replace(/\f/g, '\\f').
replace(/\r/g, '\\r').
replace(/'/g, '\\\'').
replace(/"/g, '\\"');
return str.valueOf();
}
// logging for client console
function fcn_log( s ) {
if ( typeof console != 'undefined' && console.log ) {
console.log( s );
}
}
// load widget
jQuery(document).ready(function($) {
// is form?
if ( ! $('#commentform')[0] ) {
return;
}
// check if fb is up
if ( typeof(FB) == 'undefined' ) {
$('#commentform').html( 'Facebook comments are currently unavailable' );
return;
}
// get page id
var url;
if ( fcn_global_data.permalink ) {
url = fcn_global_data.permalink;
} else {
url = window.location.href;
url = url.replace(/#.*/, '');
}
// comment form
var html = '';
if ( ! $('#fb-root')[0] ) {
html += '
';
}
html += '' ;
$('#commentform').html(html);
$('#commentform').show();
// add listener
FB.Event.subscribe("comment.create", function(response){
if ( ! response || ! response.commentID ) {
fcn_log( 'fcn: no response' );
return;
}
var href = response.href;
var commentID = response.commentID;
var parentCommentID = response.parentCommentID; // if reply
// get comments/reply text
var fbsqlComment = "SELECT text, fromid FROM comment WHERE post_fbid='"+fcn_addslashes(commentID)+"' AND ( object_id in (select comments_fbid from link_stat where url ='"+fcn_addslashes(href)+"') or object_id in (select post_fbid from comment where object_id in (select comments_fbid from link_stat where url ='"+fcn_addslashes(href)+"')))";
//fcn_log(fbsqlComment);
// get user
var commentQuery = FB.Data.query(fbsqlComment);;
var fbsqlUser = "SELECT name FROM user WHERE uid in (select fromid from {0})";
var userQuery = FB.Data.query(fbsqlUser, commentQuery);
FB.Data.waitOn([commentQuery, userQuery], function() {
var commentText = '';
var userName = '';
if ( commentQuery.value && commentQuery.value[0] ) {
var commentRow = commentQuery.value[0];
if ( commentRow ) {
commentText = commentRow.text;
}
}
if ( userQuery.value && userQuery.value[0] ) {
var userRow = userQuery.value[0];
if ( userRow.name ) {
userName = userRow.name;
}
}
// post to ajax service
var data = {
"action": "fcn_comment_created",
"href": href,
"commentID": commentID,
"parentCommentID": parentCommentID,
"commentText": commentText,
"userName": userName
};
$.post( fcn_global_data.ajaxurl, data , function(jsonstr){
var response = $.parseJSON(jsonstr);
if ( response ) {
if ( ! response.status ) {
fcn_log( response );
}
}
});
});
});
});
// source --> http://maniaevent.pl/wp-content/plugins/responsive-lightbox/assets/prettyphoto/js/jquery.prettyPhoto.min.js?ver=2.0.5
!function(t){function e(){var t=location.href;return hashtag=-1!==t.indexOf("#prettyPhoto")&&decodeURI(t.substring(t.indexOf("#prettyPhoto")+1,t.length)),hashtag&&(hashtag=hashtag.replace(/<|>/g,"")),hashtag}function i(){"undefined"!=typeof theRel&&(location.hash=theRel+"/"+rel_index+"/")}function o(){-1!==location.href.indexOf("#prettyPhoto")&&(location.hash="prettyPhoto")}function a(t,e){var i="[\\?&]"+(t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"))+"=([^]*)",o=new RegExp(i).exec(e);return null==o?"":o[1]}t.prettyPhoto={version:"3.1.6"},t.fn.prettyPhoto=function(p){function s(t,e,i,o){var a=0,p=0;return i>o?(p=t,a=Math.round(o*t/i)):(p=Math.round(i*e/o),a=e),d(p,a)}function n(){t(".pp_loaderIcon").hide(),projectedTop=scroll_pos.scrollTop+(z/2-v.containerHeight/2),projectedTop<0&&(projectedTop=0),$ppt.fadeTo(settings.animation_speed,1),$pp_pic_holder.find(".pp_content").animate({height:v.contentHeight,width:v.contentWidth},settings.animation_speed),$pp_pic_holder.animate({top:projectedTop,left:M/2-v.containerWidth/2<0?0:M/2-v.containerWidth/2,width:v.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(v.height).width(v.width),$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed),isSet&&"image"==c(pp_images[set_position])?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide(),settings.allow_expand&&(v.resized?t("a.pp_expand,a.pp_contract").show():t("a.pp_expand").hide()),!settings.autoplay_slideshow||x||y||t.prettyPhoto.startSlideshow(),settings.changepicturecallback(),y=!0}),u(),p.ajaxcallback()}function r(e){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden"),$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){t(".pp_loaderIcon").show(),e()})}function l(e){e>1?t(".pp_nav").show():t(".pp_nav").hide()}function d(t,e){if(resized=!1,h(t,e),imageWidth=t,imageHeight=e,(P>M||k>z)&&doresize&&settings.allow_resize&&!I){for(resized=!0,fitting=!1;!fitting;)P>M?(imageWidth=M-200,imageHeight=e/t*imageWidth):k>z?(imageHeight=z-200,imageWidth=t/e*imageHeight):fitting=!0,k=imageHeight,P=imageWidth;(P>M||k>z)&&d(P,k),h(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(k),containerWidth:Math.floor(P)+2*settings.horizontal_padding,contentHeight:Math.floor(w),contentWidth:Math.floor(b),resized:resized}}function h(e,i){e=parseFloat(e),i=parseFloat(i),$pp_details=$pp_pic_holder.find(".pp_details"),$pp_details.width(e),detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom")),$pp_details=$pp_details.clone().addClass(settings.theme).width(e).appendTo(t("body")).css({position:"absolute",top:-1e4}),detailsHeight+=$pp_details.height(),detailsHeight=detailsHeight<=34?36:detailsHeight,$pp_details.remove(),$pp_title=$pp_pic_holder.find(".ppt"),$pp_title.width(e),titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom")),$pp_title=$pp_title.clone().appendTo(t("body")).css({position:"absolute",top:-1e4}),titleHeight+=$pp_title.height(),$pp_title.remove(),w=i+detailsHeight,b=e,k=w+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(),P=e}function c(t){return t.match(/youtube\.com\/watch/i)||t.match(/youtu\.be/i)?"youtube":t.match(/vimeo\.com/i)?"vimeo":t.match(/\b.mov\b/i)?"quicktime":t.match(/\b.swf\b/i)?"flash":t.match(/\biframe=true\b/i)?"iframe":t.match(/\bajax=true\b/i)?"ajax":t.match(/\bcustom=true\b/i)?"custom":"#"==t.substr(0,1)?"inline":"image"}function _(){if(doresize&&"undefined"!=typeof $pp_pic_holder){if(scroll_pos=g(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=z/2+scroll_pos.scrollTop-contentHeight/2,projectedTop<0&&(projectedTop=0),contentHeight>z)return;$pp_pic_holder.css({top:projectedTop,left:M/2+scroll_pos.scrollLeft-contentwidth/2})}}function g(){return self.pageYOffset?{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}:document.documentElement&&document.documentElement.scrollTop?{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}:document.body?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:void 0}function m(){z=t(window).height(),M=t(window).width(),"undefined"!=typeof $pp_overlay&&$pp_overlay.height(t(document).height()).width(M)}function u(){isSet&&settings.overlay_gallery&&"image"==c(pp_images[set_position])?(itemWidth=57,navWidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsPerPage=Math.floor((v.containerWidth-100-navWidth)/itemWidth),itemsPerPage=itemsPerPage";toInject=settings.gallery_markup.replace(/{gallery}/g,toInject),$pp_pic_holder.find("#pp_full_res").after(toInject),$pp_gallery=t(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li"),$pp_gallery.find(".pp_arrow_next").click(function(){return t.prettyPhoto.changeGalleryPage("next"),t.prettyPhoto.stopSlideshow(),!1}),$pp_gallery.find(".pp_arrow_previous").click(function(){return t.prettyPhoto.changeGalleryPage("previous"),t.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()}),itemWidth=57,$pp_gallery_li.each(function(e){t(this).find("a").click(function(){return t.prettyPhoto.changePage(e),t.prettyPhoto.stopSlideshow(),!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('Play'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){return t.prettyPhoto.startSlideshow(),!1})),$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme),$pp_overlay.css({opacity:0,height:t(document).height(),width:t(window).width()}).bind("click",function(){settings.modal||t.prettyPhoto.close()}),t("a.pp_close").bind("click",function(){return t.prettyPhoto.close(),!1}),settings.allow_expand&&t("a.pp_expand").bind("click",function(e){return t(this).hasClass("pp_expand")?(t(this).removeClass("pp_expand").addClass("pp_contract"),doresize=!1):(t(this).removeClass("pp_contract").addClass("pp_expand"),doresize=!0),r(function(){t.prettyPhoto.open()}),!1}),$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){return t.prettyPhoto.changePage("previous"),t.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){return t.prettyPhoto.changePage("next"),t.prettyPhoto.stopSlideshow(),!1}),_()}p=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,allow_expand:!0,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,deeplinking:!0,overlay_gallery:!0,overlay_gallery_max:30,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},ie6_fallback:!0,markup:' \t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
Expand \t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
next \t\t\t\t\t\t\t\t\t\t\t
previous \t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t
Previous \t\t\t\t\t\t\t\t\t\t\t\t
0/0
\t\t\t\t\t\t\t\t\t\t\t\t
Next \t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
{pp_social}
\t\t\t\t\t\t\t\t\t\t\t
Close \t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t',gallery_markup:' \t\t\t\t\t\t\t\t
Previous \t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t{gallery} \t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
Next \t\t\t\t\t\t\t
',image_markup:'',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'{content}
',custom_markup:"",social_tools:'